from tortoise import BaseDBAsyncClient


async def upgrade(db: BaseDBAsyncClient) -> str:
    return """
        ALTER TABLE `tb_monitor_task` ADD `active` BOOL NOT NULL COMMENT '是否激活' DEFAULT 0;
        ALTER TABLE `tb_monitor_task` DROP COLUMN `status`;"""


async def downgrade(db: BaseDBAsyncClient) -> str:
    return """
        ALTER TABLE `tb_monitor_task` ADD `status` SMALLINT NOT NULL COMMENT '状态,1启动2禁用';
        ALTER TABLE `tb_monitor_task` DROP COLUMN `active`;"""
